home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Prog
/
M
/
MacOberon241.cpt
/
MacOberon 2.4(1)
/
MacQuickDraw.Mod
(
.txt
)
< prev
next >
Wrap
Oberon Text
|
1991-10-17
|
6KB
|
148 lines
Syntax10.Scn.Fnt
MODULE MacQuickDraw; (*Macintosh OS Interface Module for MacOberon 2.2, Michael Franz, 9.10.91*)
IMPORT
TY:= MacTypes, SYSTEM;
CONST
(* Transfer Modes *)
srcCopy*= 0; srcOr*= 1; srcXor*= 2; srcBic*= 3;
notSrcCopy*= 4; notSrcOr*= 5; notSrcXor*= 6; notSrcBic*= 7;
patCopy*= 8; patOr*= 9; patXor*= 10; patBic*= 11;
notPatCopy*= 12; notPatOr*= 13; notPatXor*= 14; notPatBic*= 15;
(* Colors *)
blackColor*= 33; whiteColor*= 30;
(* Styles *)
plain*= 0; bold*= 1; italic*= 2; underline*= 4;
outline*= 8; shadow*= 16; condense= 32; extend*= 64;
TYPE
Pattern*=ARRAY 8 OF TY.PackedByte;
PatPtr*= POINTER- TO Pattern;
PatHandle*= POINTER- TO RECORD p*: PatPtr END;
BitMap*= RECORD
baseAddr*: TY.Ptr;
rowBytes*: INTEGER;
bounds*: TY.Rect
END;
Cursor*= RECORD
data*, mask*: ARRAY 16 OF INTEGER;
hotSpot*: TY.Point
END;
CursPtr*= POINTER- TO Cursor;
CursHandle*= POINTER- TO RECORD p*: CursPtr END;
PenState*= RECORD
pnLoc*, pnSize*: TY.Point;
pnMode*: INTEGER;
pnPat*: Pattern
END;
Region*= RECORD (TY.Data)
rgnSize*: INTEGER;
rgnBBox*: TY.Rect;
END;
RgnPtr*= POINTER- TO Region;
RgnHandle*= POINTER- TO RECORD p*: RgnPtr END;
Picture*= RECORD
picSize*: INTEGER;
picFrame*: TY.Rect
END;
PicPtr*= POINTER- TO Picture;
PicHandle*= POINTER- TO RECORD p*: PicPtr END;
Polygon*= RECORD
polySize*: INTEGER;
polyBBox*: TY.Rect;
polyPoints*: TY.Point
END;
PolyPtr*= POINTER- TO Polygon;
PolyHandle*= POINTER- TO RECORD p*: PolyPtr END;
QDProcs= RECORD
textProc, lineProc, rectProc, rRectProc, ovalProc, arcProc, polyProc,
rgnProc, bitsProc, commentProc, txMeasProc, getPicProc, putPicProc: TY.ProcPtr
END;
QDProcsPtr= POINTER- TO QDProcs;
GrafPort*= RECORD
device: INTEGER;
portBits*: BitMap;
portRect*: TY.Rect;
visRgn*, clipRgn*: RgnHandle;
bkPat*, fillPat*: Pattern;
pnLoc*, pnSize*: TY.Point;
pnMode*: INTEGER;
pnPat*: Pattern;
pnVis*: INTEGER;
txFont*, txFace*, txMode*, txSize*: INTEGER; (* txFace: SET OF StyleItem *)
spExtra*: TY.Fixed;
fgColor*, bkColor*: LONGINT;
colrBit*, patStretch: INTEGER;
picSave, rgnSave, polySave: TY.Handle;
grafProcs: QDProcsPtr
END;
GrafPtr*= POINTER- TO GrafPort;
FontInfo* = RECORD
ascent*, descent*, widMax*, leading*: INTEGER
END;
Globals* = RECORD
(TY.Data) (* QD offsets *) (* Oberon offsets *)
randSeed*: LONGINT; (* -126 *) (* 0 *)
screenBits*: BitMap; (* -122 *) (* 4 *)
arrow*: Cursor; (* -108 *) (* 18 *)
dkGray*, ltGray*, gray*, black*, white*: Pattern; (* -40, ... -8 *) (* 86, 94, 102, 110, 118 *)
thePort*: GrafPtr (* 0 *) (* 126 *)
END;
GlobalsPtr* = POINTER- TO Globals; (* Initialized to 0(A5) - 126 *)
globals*: GlobalsPtr;
PROCEDURE - SetPort*(port: GrafPtr) 0A8H, 073H;
PROCEDURE - GetPort*(VAR port: GrafPtr) 0A8H, 074H;
PROCEDURE - OpenPort*(port: GrafPtr) 0A8H, 06FH;
PROCEDURE - ClosePort*(port: GrafPtr) 0A8H, 07DH;
PROCEDURE - PenSize*(width, height: INTEGER) 0A8H, 09BH;
PROCEDURE - PenPat*(pat: Pattern) 0A8H, 09DH;
PROCEDURE - SetOrigin*(h, v: INTEGER) 0A8H, 078H;
PROCEDURE - SetClip*(rgn: RgnHandle) 0A8H, 079H;
PROCEDURE - GetClip*(rgn: RgnHandle) 0A8H, 07AH;
PROCEDURE - ClipRect*(r: TY.Rect) 0A8H, 07BH;
PROCEDURE - BackPat*(pat: Pattern) 0A8H, 07CH;
PROCEDURE - SetCursor*(crsr: Cursor) 0A8H, 051H;
PROCEDURE - HideCursor*() 0A8H, 052H;
PROCEDURE - ShowCursor*() 0A8H, 053H;
PROCEDURE - ObscureCursor* 0A8H, 056H;
PROCEDURE - MoveTo*(h, v: INTEGER) 0A8H, 093H;
PROCEDURE - LineTo*(h, v: INTEGER) 0A8H, 091H;
PROCEDURE - SetRect*(VAR r: TY.Rect; left, top, right,bottom: INTEGER) 0A8H, 0A7H;
PROCEDURE - OffsetRect*(VAR r: TY.Rect; dh, dv: INTEGER) 0A8H, 0A8H;
PROCEDURE - UnionRect*(src1, src2: TY.Rect; VAR dstRect: TY.Rect) 0A8H, 0ABH;
PROCEDURE - InsetRect*(r: TY.Rect; dh, dv: INTEGER) 0A8H, 0A9H;
PROCEDURE - EraseRect*(r: TY.Rect) 0A8H, 0A3H;
PROCEDURE - FrameRect*(r: TY.Rect) 0A8H, 0A1H;
PROCEDURE - InvertRect*(r: TY.Rect) 0A8H, 0A4H;
PROCEDURE - FillRect*(r: TY.Rect; pat: Pattern) 0A8H, 0A5H;
PROCEDURE - FrameRoundRect*(r: TY.Rect; ovalWidth, ovalHeight: INTEGER) 0A8H, 0B0H;
PROCEDURE - SectRect*(src1, src2: TY.Rect; VAR dstRect: TY.Rect): BOOLEAN 0A8H, 0AAH;
PROCEDURE - PtInRect*(pt: TY.Point; r: TY.Rect): BOOLEAN 0A8H, 0ADH;
PROCEDURE - NewRgn*(): RgnHandle 0A8H, 0D8H;
PROCEDURE - DisposeRgn*(rgn: RgnHandle) 0A8H, 0D9H;
PROCEDURE - CopyRgn*(srcRgn, dstRgn: RgnHandle) 0A8H, 0DCH;
PROCEDURE - SetRectRgn*(rgn: RgnHandle; left, top, right, bottom: INTEGER) 0A8H, 0DEH;
PROCEDURE - RectRgn*(rgn: RgnHandle;r: TY.Rect) 0A8H, 0DFH;
PROCEDURE - SectRgn*(srcRgnA, srcRgnB, dstRgn: RgnHandle) 0A8H, 0E4H;
PROCEDURE - DiffRgn*(srcRgnA, srcRgnB, dstRgn: RgnHandle) 0A8H, 0E6H;
PROCEDURE - EmptyRgn*(rgn: RgnHandle): BOOLEAN 0A8H, 0E2H;
PROCEDURE - PtInRgn*(pt: TY.Point; rgn: RgnHandle): BOOLEAN 0A8H, 0E8H;
PROCEDURE - CopyBits*(srcBits, dstBits: BitMap; srcRect, dstRect: TY.Rect; mode: INTEGER; maskRgn: RgnHandle) 0A8H, 0ECH;
PROCEDURE - LocalToGlobal*(VAR pt: TY.Point) 0A8H, 070H;
PROCEDURE - GlobalToLocal*(VAR pt: TY.Point) 0A8H, 071H;
PROCEDURE - StuffHex*(thingPtr: TY.Ptr; s: TY.Str255) 0A8H, 066H;
PROCEDURE - DrawPicture*(myPicture: PicHandle; dstRect: TY.Rect) 0A8H, 0F6H;
PROCEDURE - TextFont*(font: INTEGER) 0A8H, 087H;
PROCEDURE - TextSize*(size: INTEGER) 0A8H, 08AH;
PROCEDURE - CharWidth*(ch: INTEGER): INTEGER 0A8H, 08DH;
PROCEDURE - StringWidth*(s: TY.Str255): INTEGER 0A8H, 08CH;
PROCEDURE - GetPenState*(VAR pnState: PenState) 0A8H, 098H;
PROCEDURE - SetPenState*(VAR pnState: PenState) 0A8H, 099H;
PROCEDURE - PenNormal* 0A8H, 09EH;
PROCEDURE - DrawChar*(ch: INTEGER) 0A8H, 083H;
PROCEDURE - DrawString*(s: TY.Str255) 0A8H, 084H;
PROCEDURE - GetFontInfo*(VAR info: FontInfo) 0A8H, 08BH;
BEGIN
SYSTEM.GETREG(13, globals);
SYSTEM.GET(SYSTEM.VAL(LONGINT, globals), globals); (* Mem[A5] *)
DEC(SYSTEM.VAL(LONGINT, globals), 126)
END MacQuickDraw.